package com.ruoyi.service.jpjs.expensereport.impl;

import com.ruoyi.mapper.jpjs.expensereport.ExpenseReportMapper;
import com.ruoyi.service.jpjs.PublicService;
import com.ruoyi.service.jpjs.expensereport.ExpenseReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service
public class ExpenseReportServiceimpl implements ExpenseReportService {

    @Autowired
    ExpenseReportMapper reportMapper;

    @Autowired
    PublicService publicService;

    @Override
    public List<Map<String, Object>> list(Map map) {
        List<Map<String, Object>> compList = publicService.findUserComp();
        map.put("compList", compList);
        return reportMapper.list(map);
    }

    @Override
    public int add(Map map) {
        return reportMapper.add(map);
    }

    @Override
    public Map<String, Object> findExpenseReportById(String id) {
        return reportMapper.findExpenseReportById(id);
    }

    @Override
    public int edit(Map map) {
        return reportMapper.edit(map);
    }

    @Override
    public List<Map<String, Object>> findProList(Map map) {
        List<Map<String, Object>> compList = publicService.findUserComp();
        map.put("compList", compList);
        return reportMapper.findProList(map);
    }



    @Override
    public int addProValue(Map map) {
        return reportMapper.addProValue(map);
    }

    @Override
    public List<Map<String, Object>> findProByCompId(String compId,String valueType) {
        return reportMapper.findProByCompId(compId,valueType);
    }

    @Override
    public int editProValue(Map map) {
        return reportMapper.editProValue(map);
    }

    @Override
    public int findYearProCount(Map map) {
        return reportMapper.findYearProCount(map);
    }

    @Override
    public String findYearProMonthCount(Map map) {
        return reportMapper.findYearProMonthCount(map);
    }

    @Override
    public List<Map<String, Object>> findDepList(Map map) {
        List<Map<String, Object>> compList = publicService.findUserComp();
        map.put("compList", compList);
        return reportMapper.findDepList(map);
    }

    @Override
    public int addDepValue(Map map) {
        return reportMapper.addDepValue(map);
    }

    @Override
    public int editDepValue(Map map) {
        return reportMapper.editDepValue(map);
    }

    @Override
    public int findYearDepCount(Map map) {
        return reportMapper.findYearDepCount(map);
    }

    @Override
    public String findYearDepMonthCount(Map map) {
        return reportMapper.findYearDepMonthCount(map);
    }

    @Override
    public Map<String, Object> findMonthExpenseReportById(String id) {
        return reportMapper.findMonthExpenseReportById(id);
    }
}
